DNS Address Structure
You can use the DNS (domain name system) address structure with theOTConnect
function when you are creating a TCP endpoint, with theOTSndUData
function when you are creating a UDP endpoint, or with theOTResolveAddress
function with either TCP or UDP endpoints. If you do so, the domain name resolver (DNR) will resolve the address for you automatically. You can use theOTInitDNSAddress
function (page 8-53) to fill in a DNS address structure. The DNS address structure is defined by theDNSAddress
data type.
struct DNSAddress { OTAddressType fAddressType;/* address type; always AF_DNS */ InetDomainName fName; /* domain name */ };This address you specify can be just the host name ("otteam"), a partially qualified domain name ("otteam.ssw"), a fully qualified domain name ("otteam.ssw.apple.com."), or an internet address in dotted-decimal format ("17.202.99.99"), and can optionally include the port number ("otteam.ssw.apple.com:25" or "17.202.99.99:25").
Field Description
fAddressType
- The address type. The only possible value for this field is
AF_DNS
.fName
- The address to be resolved by the DNR.
Because the port number is not actually part of the domain name, it is possible to have a domain name-port number combination that exceeds 255 bytes. If you wish to specify such a string, you must provide a structure based on the DNS address structure that has sufficient space to contain the full string. In any case, the domain name itself cannot exceed 255 bytes.
You can use the DNS address structure to provide an unresolved TCP address with the
OTConnect
function or a UDP address with theOTSndUData
function. To do so, specify a pointer to the DNS address structure as theudata->addr.buf
parameter in your call to theOTSndUData
function or as thesndCall->addr.buf
parameter in your call to theOTConnect
function.